<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>任务详情 - 威客平台</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    :root {
      --primary: #2C6ECB;
      --primary-light: #E8F0FE;
      --success: #36B37E;
      --warning: #FFAB00;
      --danger: #FF5630;
      --text-primary: #172B4D;
      --text-secondary: #6B778C;
      --border-light: #E5E8EF;
      --bg-white: #FFFFFF;
      --bg-light: #F4F5F7;
      --gray-100: #F9FAFC;
    }
    
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: var(--bg-light);
      color: var(--text-primary);
      padding-bottom: 80px;
      margin: 0;
    }
    
    /* 顶部导航 */
    .page-header {
      background-color: var(--bg-white);
      padding: 15px 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border-light);
      position: sticky;
      top: 0;
      z-index: 100;
    }
    
    .header-btn {
      background: none;
      border: none;
      color: var(--text-primary);
      font-size: 20px;
    }
    
    .header-title {
      font-size: 18px;
      font-weight: 600;
    }
    
    /* 任务发布者信息 */
    .task-publisher {
      background-color: var(--bg-white);
      padding: 16px;
      display: flex;
      align-items: center;
      border-bottom: 1px solid var(--border-light);
    }
    
    .publisher-avatar {
      width: 50px;
      height: 50px;
      border-radius: 50%;
      object-fit: cover;
      margin-right: 12px;
    }
    
    .publisher-info {
      flex: 1;
    }
    
    .publisher-name {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 3px;
    }
    
    .publisher-meta {
      font-size: 12px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .publisher-rating {
      color: var(--warning);
    }
    
    .contact-btn {
      padding: 6px 14px;
      background-color: var(--primary);
      color: white;
      border: none;
      border-radius: 20px;
      font-size: 14px;
      display: flex;
      align-items: center;
      gap: 5px;
    }
    
    /* 任务内容容器 */
    .task-container {
      background-color: var(--bg-white);
      margin-bottom: 10px;
    }
    
    /* 任务标题和状态 */
    .task-header {
      padding: 16px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .task-status {
      display: inline-block;
      font-size: 12px;
      padding: 2px 8px;
      border-radius: 4px;
      background-color: var(--success);
      color: white;
      margin-bottom: 8px;
    }
    
    .task-status.pending {
      background-color: var(--warning);
    }
    
    .task-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 10px;
      line-height: 1.4;
    }
    
    .task-price {
      font-size: 18px;
      font-weight: 600;
      color: var(--danger);
      margin-bottom: 10px;
    }
    
    /* 任务详情内容 */
    .task-content {
      padding: 16px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .task-section-title {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .task-description {
      font-size: 15px;
      line-height: 1.7;
      margin-bottom: 16px;
    }
    
    /* 任务图片展示 */
    .task-images {
      margin: 16px 0;
    }
    
    .single-image {
      width: 100%;
      border-radius: 8px;
      margin-bottom: 8px;
    }
    
    .image-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 8px;
    }
    
    .grid-image {
      width: 100%;
      aspect-ratio: 1;
      object-fit: cover;
    }
    
    /* 任务信息卡片 */
    .task-info-card {
      background-color: var(--gray-100);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 16px;
    }
    
    .info-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid var(--border-light);
      font-size: 14px;
    }
    
    .info-row:last-child {
      border-bottom: none;
    }
    
    .info-label {
      color: var(--text-secondary);
    }
    
    .info-value {
      font-weight: 500;
    }
    
    .urgent-tag {
      color: var(--danger);
      font-weight: 500;
    }
    
    /* 任务标签 */
    .task-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 16px;
    }
    
    .task-tag {
      font-size: 12px;
      padding: 3px 10px;
      border-radius: 4px;
      background-color: var(--primary-light);
      color: var(--primary);
    }
    
    /* 任务操作区 */
    .task-actions {
      display: flex;
      padding: 12px 16px;
      border-top: 1px solid var(--border-light);
      border-bottom: 1px solid var(--border-light);
    }
    
    .action-button {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      background: none;
      border: none;
      color: var(--text-secondary);
      font-size: 12px;
      gap: 5px;
    }
    
    .action-button.active {
      color: var(--primary);
    }
    
    .action-icon {
      font-size: 18px;
    }
    
    /* 申请按钮 */
    .apply-section {
      padding: 16px;
      background-color: var(--bg-white);
    }
    
    .apply-btn {
      width: 100%;
      padding: 14px 0;
      background-color: var(--primary);
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 10px;
    }
    
    .apply-note {
      font-size: 13px;
      color: var(--text-secondary);
      text-align: center;
    }
    
    /* 留言区 */
    .messages-section {
      background-color: var(--bg-white);
      padding: 16px;
      margin-top: 10px;
    }
    
    .messages-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
    }
    
    .messages-title {
      font-size: 16px;
      font-weight: 600;
    }
    
    /* 留言输入框 */
    .message-input-container {
      display: flex;
      gap: 10px;
      margin-bottom: 20px;
    }
    
    .user-avatar-small {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      object-fit: cover;
    }
    
    .message-input-wrapper {
      flex: 1;
      position: relative;
    }
    
    .message-input {
      width: 100%;
      padding: 12px 15px;
      border: 1px solid var(--border-light);
      border-radius: 20px;
      background-color: var(--gray-100);
      font-size: 14px;
      resize: none;
      height: 40px;
      overflow: hidden;
    }
    
    .message-input:focus {
      outline: none;
      border-color: var(--primary);
      background-color: white;
    }
    
    .send-message {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--primary);
      font-size: 18px;
    }
    
    /* 留言列表 */
    .messages-list {
      margin-bottom: 20px;
    }
    
    .message-item {
      display: flex;
      gap: 10px;
      margin-bottom: 16px;
    }
    
    .message-content {
      flex: 1;
    }
    
    .message-text {
      background-color: var(--gray-100);
      padding: 10px 14px;
      border-radius: 18px 18px 18px 0;
      font-size: 14px;
      margin-bottom: 5px;
    }
    
    .message-meta {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 12px;
      color: var(--text-secondary);
    }
    
    .message-author {
      font-weight: 500;
      color: var(--text-primary);
    }
    
    .message-actions {
      display: flex;
      gap: 12px;
    }
    
    .message-action {
      color: var(--text-secondary);
      text-decoration: none;
    }
    
    .message-action:hover {
      color: var(--primary);
    }
    
    /* 回复样式 */
    .replies-container {
      margin-left: 46px;
      margin-top: 10px;
    }
    
    .reply-item {
      display: flex;
      gap: 10px;
      margin-bottom: 10px;
    }
    
    .reply-text {
      background-color: var(--gray-100);
      padding: 8px 12px;
      border-radius: 14px 14px 14px 0;
      font-size: 13px;
      margin-bottom: 5px;
    }
    
    .reply-to {
      color: var(--primary);
      font-weight: 500;
    }
    
    /* 底部操作栏 */
    .bottom-action-bar {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: var(--bg-white);
      border-top: 1px solid var(--border-light);
      padding: 10px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      z-index: 100;
    }
    
    .bottom-input {
      flex: 1;
      padding: 10px 15px;
      border: 1px solid var(--border-light);
      border-radius: 20px;
      background-color: var(--gray-100);
      font-size: 14px;
    }
    
    .bottom-action {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background-color: var(--gray-100);
      border: none;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .emoji-btn {
      font-size: 18px;
    }
    
    .send-btn {
      background-color: var(--primary);
      color: white;
    }
    
    /* 加载更多 */
    .load-more {
      width: 100%;
      padding: 10px;
      background-color: var(--gray-100);
      border: 1px solid var(--border-light);
      border-radius: 6px;
      color: var(--text-secondary);
      font-size: 14px;
      margin-top: 10px;
    }
  </style>
</head>
<body>
  <!-- 顶部导航 -->
  <div class="page-header">
    <button class="header-btn" id="backBtn">
      <i class="fa fa-arrow-left"></i>
    </button>
    <div class="header-title">任务详情</div>
    <button class="header-btn">
      <i class="fa fa-share-alt"></i>
    </button>
  </div>
  
  <!-- 任务发布者信息 -->
  <div class="task-publisher">
    <img src="https://picsum.photos/100/100?random=1" alt="发布者头像" class="publisher-avatar">
    <div class="publisher-info">
      <div class="publisher-name">科技先锋有限公司</div>
      <div class="publisher-meta">
        <span><i class="fa fa-user-o"></i> 企业认证</span>
        <span class="publisher-rating"><i class="fa fa-star"></i> 4.9 (128)</span>
        <span><i class="fa fa-clock-o"></i> 3年</span>
      </div>
    </div>
    <button class="contact-btn">
      <i class="fa fa-comments-o"></i> 联系
    </button>
  </div>
  
  <!-- 任务内容容器 -->
  <div class="task-container">
    <!-- 任务标题和状态 -->
    <div class="task-header">
      <span class="task-status">未接单</span>
      <h1 class="task-title">公司VI设计全套，包括Logo、名片、信封等办公用品</h1>
      <div class="task-price">预算：¥1800</div>
    </div>
    
    <!-- 任务详情内容 -->
    <div class="task-content">
      <h2 class="task-section-title">
        <i class="fa fa-file-text-o"></i> 任务描述
      </h2>
      <div class="task-description">
        我们是一家新兴科技公司，专注于人工智能解决方案，现需要设计全套VI系统，包括但不限于：
        <br><br>
        1. 公司Logo设计（需要提供3-5个方案供选择）<br>
        2. 名片设计<br>
        3. 信封和信纸设计<br>
        4. 工作证设计<br>
        5. PPT模板设计<br>
        <br>
        要求风格现代简约，体现科技感和创新精神，色彩以蓝色系为主。选中方案后需要提供各种格式的源文件。
      </div>
      
      <h2 class="task-section-title">
        <i class="fa fa-picture-o"></i> 参考图片
      </h2>
      <div class="task-images">
        <div class="image-grid">
          <img src="https://picsum.photos/300/300?random=10" alt="参考设计1" class="grid-image">
          <img src="https://picsum.photos/300/300?random=11" alt="参考设计2" class="grid-image">
          <img src="https://picsum.photos/300/300?random=12" alt="参考设计3" class="grid-image">
        </div>
        <img src="https://picsum.photos/600/400?random=13" alt="风格参考" class="single-image">
      </div>
      
      <h2 class="task-section-title">
        <i class="fa fa-list-alt"></i> 任务信息
      </h2>
      <div class="task-info-card">
        <div class="info-row">
          <div class="info-label">任务类型</div>
          <div class="info-value">设计创意 > VI设计</div>
        </div>
        <div class="info-row">
          <div class="info-label">发布时间</div>
          <div class="info-value">2023-06-15</div>
        </div>
        <div class="info-row">
          <div class="info-label">截止时间</div>
          <div class="info-value">2023-06-30</div>
        </div>
        <div class="info-row">
          <div class="info-label">任务状态</div>
          <div class="info-value">未接单</div>
        </div>
        <div class="info-row">
          <div class="info-label">项目类型</div>
          <div class="info-value">一次性任务</div>
        </div>
        <div class="info-row">
          <div class="info-label">工作方式</div>
          <div class="info-value">线上远程</div>
        </div>
        <div class="info-row">
          <div class="info-label">紧急程度</div>
          <div class="info-value urgent-tag"><i class="fa fa-fire"></i> 一般</div>
        </div>
      </div>
      
      <h2 class="task-section-title">
        <i class="fa fa-tags"></i> 相关标签
      </h2>
      <div class="task-tags">
        <span class="task-tag">VI设计</span>
        <span class="task-tag">Logo设计</span>
        <span class="task-tag">科技公司</span>
        <span class="task-tag">现代简约</span>
        <span class="task-tag">企业形象</span>
      </div>
    </div>
    
    <!-- 任务操作区 -->
    <div class="task-actions">
      <button class="action-button">
        <i class="fa fa-heart-o action-icon"></i>
        <span>收藏</span>
      </button>
      <button class="action-button">
        <i class="fa fa-share-alt action-icon"></i>
        <span>分享</span>
      </button>
      <button class="action-button">
        <i class="fa fa-flag-o action-icon"></i>
        <span>举报</span>
      </button>
      <button class="action-button">
        <i class="fa fa-history action-icon"></i>
        <span>浏览</span>
      </button>
    </div>
  </div>
  
  <!-- 申请按钮区域 -->
  <div class="apply-section">
    <button class="apply-btn">立即申请接取任务</button>
    <div class="apply-note">已有 12 人申请接取此任务</div>
  </div>
  
  <!-- 留言区 -->
  <div class="messages-section">
    <div class="messages-header">
      <h2 class="messages-title">留言咨询 (12)</h2>
    </div>
    
    <!-- 留言输入框 -->
    <div class="message-input-container">
      <img src="https://picsum.photos/100/100?random=20" alt="用户头像" class="user-avatar-small">
      <div class="message-input-wrapper">
        <textarea class="message-input" placeholder="写下你的问题或留言..."></textarea>
        <button class="send-message">
          <i class="fa fa-paper-plane"></i>
        </button>
      </div>
    </div>
    
    <!-- 留言列表 -->
    <div class="messages-list">
      <!-- 留言1 -->
      <div class="message-item">
        <img src="https://picsum.photos/100/100?random=21" alt="留言者头像" class="user-avatar-small">
        <div class="message-content">
          <div class="message-text">
            请问公司名称的中英文全称是什么？设计时需要包含全称吗？
          </div>
          <div class="message-meta">
            <span class="message-author">设计达人</span>
            <span>昨天 14:30</span>
            <div class="message-actions">
              <a href="#" class="message-action">回复</a>
            </div>
          </div>
          
          <!-- 留言1的回复 -->
          <div class="replies-container">
            <div class="reply-item">
              <img src="https://picsum.photos/100/100?random=1" alt="回复者头像" class="user-avatar-small">
              <div class="message-content">
                <div class="reply-text">
                  <span class="reply-to">@设计达人</span> 公司全称为"科技先锋人工智能有限公司"，英文是"TechPioneer AI Co., Ltd"，Logo中需要包含中英文简称"TechPioneer"和"科技先锋"。
                </div>
                <div class="message-meta">
                  <span class="message-author">科技先锋有限公司</span>
                  <span>昨天 15:45</span>
                  <div class="message-actions">
                    <a href="#" class="message-action">回复</a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 留言2 -->
      <div class="message-item">
        <img src="https://picsum.photos/100/100?random=22" alt="留言者头像" class="user-avatar-small">
        <div class="message-content">
          <div class="message-text">
            我有5年VI设计经验，之前为3家科技公司做过全套设计，能看看你们更具体的要求吗？比如有没有特别喜欢的风格案例？
          </div>
          <div class="message-meta">
            <span class="message-author">创意工作室</span>
            <span>2天前</span>
            <div class="message-actions">
              <a href="#" class="message-action">回复</a>
            </div>
          </div>
        </div>
      </div>
      
      <!-- 留言3 -->
      <div class="message-item">
        <img src="https://picsum.photos/100/100?random=23" alt="留言者头像" class="user-avatar-small">
        <div class="message-content">
          <div class="message-text">
            请问选中方案后，修改次数有限制吗？交付周期可以协商吗？
          </div>
          <div class="message-meta">
            <span class="message-author">视觉设计师</span>
            <span>3天前</span>
            <div class="message-actions">
              <a href="#" class="message-action">回复</a>
            </div>
          </div>
          
          <!-- 留言3的回复 -->
          <div class="replies-container">
            <div class="reply-item">
              <img src="https://picsum.photos/100/100?random=1" alt="回复者头像" class="user-avatar-small">
              <div class="message-content">
                <div class="reply-text">
                  <span class="reply-to">@视觉设计师</span> 选中后可以免费修改3次，周期可以根据实际情况协商，但希望不晚于6月30日完成。
                </div>
                <div class="message-meta">
                  <span class="message-author">科技先锋有限公司</span>
                  <span>3天前</span>
                  <div class="message-actions">
                    <a href="#" class="message-action">回复</a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    
    <!-- 加载更多留言 -->
    <button class="load-more">
      加载更多留言
    </button>
  </div>
  
  <!-- 底部快捷留言栏 -->
  <div class="bottom-action-bar">
    <button class="bottom-action emoji-btn">
      <i class="fa fa-smile-o"></i>
    </button>
    <input type="text" class="bottom-input" placeholder="咨询任务细节...">
    <button class="bottom-action send-btn">
      <i class="fa fa-paper-plane"></i>
    </button>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 返回按钮
    document.getElementById('backBtn').addEventListener('click', function() {
      history.back();
    });
    
    // 任务操作按钮交互
    document.querySelectorAll('.action-button').forEach(btn => {
      btn.addEventListener('click', function() {
        // 收藏按钮逻辑
        if (this.querySelector('.fa-heart-o') || this.querySelector('.fa-heart')) {
          this.classList.toggle('active');
          if (this.classList.contains('active')) {
            this.innerHTML = '<i class="fa fa-heart action-icon"></i><span>已收藏</span>';
          } else {
            this.innerHTML = '<i class="fa fa-heart-o action-icon"></i><span>收藏</span>';
          }
        } 
        // 分享按钮
        else if (this.querySelector('.fa-share-alt')) {
          alert('分享任务：可分享到微信、QQ、微博等');
        }
        // 举报按钮
        else if (this.querySelector('.fa-flag-o')) {
          alert('举报功能：请选择举报原因');
        }
        // 浏览记录
        else if (this.querySelector('.fa-history')) {
          alert('已添加到浏览记录');
        }
      });
    });
    
    // 申请接取任务
    document.querySelector('.apply-btn').addEventListener('click', function() {
      alert('申请接取任务成功，请等待雇主审核');
    });
    
    // 联系发布者
    document.querySelector('.contact-btn').addEventListener('click', function() {
      alert('正在打开与科技先锋有限公司的聊天窗口');
    });
    
    // 留言输入框自动调整高度
    const messageInput = document.querySelector('.message-input');
    messageInput.addEventListener('input', function() {
      this.style.height = 'auto';
      // 限制最大高度
      if (this.scrollHeight > 100) {
        this.style.height = '100px';
        this.style.overflowY = 'auto';
      } else {
        this.style.height = this.scrollHeight + 'px';
        this.style.overflowY = 'hidden';
      }
    });
    
    // 发送留言
    document.querySelector('.send-message').addEventListener('click', function() {
      sendMessage();
    });
    
    document.querySelector('.bottom-input').addEventListener('keypress', function(e) {
      if (e.key === 'Enter') {
        sendMessage();
      }
    });
    
    document.querySelector('.send-btn').addEventListener('click', function() {
      sendMessage();
    });
    
    // 发送留言函数
    function sendMessage() {
      const inputElem = document.querySelector('.message-input').value.trim() || 
                       document.querySelector('.bottom-input').value.trim();
      
      if (inputElem) {
        alert('留言已发送：' + inputElem);
        document.querySelector('.message-input').value = '';
        document.querySelector('.message-input').style.height = '40px';
        document.querySelector('.bottom-input').value = '';
      }
    }
    
    // 回复功能
    document.querySelectorAll('.message-action').forEach(action => {
      if (action.textContent === '回复') {
        action.addEventListener('click', function(e) {
          e.preventDefault();
          const authorName = this.closest('.message-meta').querySelector('.message-author').textContent;
          document.querySelector('.bottom-input').value = '@' + authorName + ' ';
          document.querySelector('.bottom-input').focus();
        });
      }
    });
    
    // 加载更多留言
    document.querySelector('.load-more').addEventListener('click', function() {
      this.innerHTML = '<i class="fa fa-spinner fa-spin"></i> 加载中...';
      // 模拟加载延迟
      setTimeout(() => {
        this.textContent = '没有更多留言了';
        this.disabled = true;
        this.style.opacity = '0.7';
      }, 1500);
    });
  </script>
</body>
</html>
